package study2018.com.xtianzhuang.www.test;

import java.util.Scanner;

public class Main2 {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int num = s.nextInt();
		String[] strs = String.valueOf(num).split("");
		String str = "";
		for (int i = strs.length - 1; i >= 0; i--) {
			str += strs[i];
		}

		if (str.startsWith("0000")) {
			str.replace("0000", "");
		} else if (str.startsWith("000")) {
			str.replaceFirst("0000", "");
		} else if (str.startsWith("00")) {
			str.replaceFirst("00", "");
		} else if (str.startsWith("0")) {
			str.replaceFirst("0", "");
		}
		int num2 = Integer.valueOf(str);
		System.out.println(num + num2);

	}
}
